<?php
/**
 * 金额记录
 * User: lxq
 * Date: 2018/4/25
 * Time: 15:35
 */
class pd_logModel extends  Model{

    public function __construct()
    {
        parent::__construct('pd_log');
    }

    /**
     * 获取列表分页
     * @param array $condition
     * @param string $field
     * @param int $page
     * @param string $order
     * @return mixed
     */
    public function getPd_logListPage($condition = array(), $field = '*', $page = 0, $order = 'log_id desc'){
        return $this->field($field)->where($condition)->page($page)->order($order)->select();
    }

    /**
     * 获取一条记录的详细信息
     * @param array $condition
     * @param string $field
     * @return mixed
     */
    public function getPd_logInfo($condition = array(), $field = '*')
    {
        return $this->field($field)->where($condition)->find();
    }

    /**
     * 插入一条记录
     * @param array $params
     * @return mixed
     */
    public function addPd_log($params)
    {
        return $this->insert($params);
    }

    /**
     * 更新记录
     * @param array $condition
     * @param array $params
     * @return mixed
     */
    public function updatePd_log($condition, $params)
    {
        return $this->where($condition)->update($params);
    }

    /**
     * 获取记录数组
     * @param array $condition
     * @param string $field
     * @param string $order
     * @return mixed
     */
    public function getPd_logList($condition = array(), $field = '*', $order = 'spec_id desc'){
        return $this->field($field)->where($condition)->order($order)->select();
    }

    /**
     * 删除记录
     * @param array $condition
     */
    public function deletePd_log($condition)
    {
        return $this->where($condition)->delete();
    }
}